<script lang="ts" setup>
import { getMessage } from "@/api/chat";
import { ref } from "vue";
import type { MessageEntity } from "@/typings/api/chat";
import { NAvatar, NIcon } from "naive-ui";
import { PeopleCircle } from "@vicons/ionicons5";

const messageList = ref<MessageEntity[]>([]);

/**获取消息 */
const getMessages = async (sessionId: string) => {
  try {
    const { code, data } = await getMessage(sessionId);
    if (code === 200) {
      messageList.value = data;
    }
  } catch (error) {}
};

defineExpose({
  getMessages,
});
</script>

<template>
  <div class="chat-message">
    <!-- <div v-for="message in messageList" :key="message.id"> -->
    <NAvatar>
      <NIcon>
        <PeopleCircle />
      </NIcon>
    </NAvatar>
    <!-- </div> -->
  </div>
</template>

<style lang="less" scoped></style>
